while True:
    guest_name1 = input("请输入你的用户名：")
    if guest_name1 == "q":
        break
    guest_name2 = f"{guest_name1}\n"
    with open("guest.txt", "a+", encoding="utf-8") as f:

        f.write(guest_name2)